<!doctype html>
<html>
<head>
  <meta charset="UTF-8">
  <meta name="App-Config" content="fullscreen=yes,useHistoryState=yes,transition=yes">
  <meta content="telephone=no,email=no" name="format-detection">
  <meta name="viewport" content="width=device-width,initial-scale=1.0,minimum-scale=1.0,maximum-scale=1.0,user-scalable=no,viewport-fit=cover">
  <meta name="author" content="touhaoshiwan.com">
  <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0, shrink-to-fit=no">
  <!-- 最新 Bootstrap 核心 CSS 文件 -->
  <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap@3.3.7/dist/css/bootstrap.min.css" integrity="sha384-BVYiiSIFeK1dGmJRAkycuHAHRg32OmUcww7on3RYdg4Va+PmSTsz/K68vbdEjh4u" crossorigin="anonymous">
  <link rel="stylesheet" href="/css/theme.min.css">
  <link rel="stylesheet" href="/css/jquery.datetimepicker.min.css?v1">
  <link rel="stylesheet" href="/css/yhBase.css?v1">
  <title>后台管理系统</title>
  <script src="https://cdn.jsdelivr.net/npm/jquery@3.3.1/dist/jquery.min.js"></script>
  <script src="https://cdn.jsdelivr.net/npm/bootstrap@3.3.7/dist/js/bootstrap.min.js" integrity="sha384-Tc5IQib027qvyjSMfHjOMaLkfuWVxZxUPnCJA7l2mCWNIpG9mGCD8wGNIcPD7Txa" crossorigin="anonymous"></script>
  <script src="/js/jquery.datetimepicker.min.js"></script>
  <!--   表单验证-->
  <script src="https://cdn.jsdelivr.net/npm/parsleyjs@2.8.1/dist/parsley.min.js"></script>
</head>
<body>
<div class="container">
  <nav class="navbar navbar-expand-lg navbar-light bg-light self_nav">
    <div class="collapse navbar-collapse" id="navbarColor01">
      <ul class="navbar-nav mr-auto">
        <li <?php if ($this->layout['current_controller'] == 'index' && $this->layout['current_module'] == 'index'): ?> class="active nav-item" <?php else:?> class="nav-item"   <?php endif; ?> >
          <a href="/manage/index/index" class="nav-link">首页</a>
        </li>
        <li <?php if ($this->layout['current_controller'] == 'aso' && $this->layout['current_module'] == 'manage'): ?> class="active nav-item dropdown" <?php else:?> class="nav-item dropdown"   <?php endif; ?>>
          <a class="nav-link dropdown-toggle" data-toggle="dropdown" href="#" role="button" aria-haspopup="true" aria-expanded="true">任务管理</a>
          <div class="dropdown-menu" x-placement="bottom-start" style="position: absolute; transform: translate3d(0px, 35px, 0px); top: 0px; left: 0px; will-change: transform;">
            <?php foreach ($this->layout['menu_list']['aso']['aso']['childs'] as $action => $child_row): ?>
              <a class="dropdown-item" href="<?php echo $child_row['href'] ?>"><?php echo $child_row['title'] ?></a>
            <?php endforeach; ?>
          </div>
        </li>
        <li <?php if ($this->layout['current_controller'] == 'degree' && $this->layout['current_module'] == 'manage'): ?> class="active nav-item dropdown" <?php else:?> class="nav-item dropdown" <?php endif; ?>>
          <a class="nav-link dropdown-toggle" data-toggle="dropdown" href="#" role="button" aria-haspopup="true" aria-expanded="true">高额任务管理</a>
          <div class="dropdown-menu" x-placement="bottom-start" style="position: absolute; transform: translate3d(0px, 35px, 0px); top: 0px; left: 0px; will-change: transform;">
              <?php foreach ($this->layout['menu_list']['degree']['degree']['childs'] as $action => $child_row): ?>
                <a class="dropdown-item" href="<?php echo $child_row['href'] ?>"><?php echo $child_row['title'] ?></a>
              <?php endforeach; ?>
          </div>
        </li>

        <li <?php if ($this->layout['current_controller'] == 'user' && $this->layout['current_module'] == 'manage'): ?> class="active nav-item dropdown" <?php else:?> class="nav-item dropdown"  <?php endif; ?> >
          <a class="nav-link dropdown-toggle" data-toggle="dropdown" href="#" role="button" aria-haspopup="true" aria-expanded="true">用户管理</a>
          <div class="dropdown-menu" x-placement="bottom-start" style="position: absolute; transform: translate3d(0px, 35px, 0px); top: 0px; left: 0px; will-change: transform;">
              <?php foreach ($this->layout['menu_list']['user']['user']['childs'] as $action => $child_row): ?>
                <a class="dropdown-item" href="<?php echo $child_row['href'] ?>"><?php echo $child_row['title'] ?></a>
              <?php endforeach; ?>
          </div>
        </li>
        <li <?php if ($this->layout['current_controller'] == 'stat' && $this->layout['current_module'] == 'manage'): ?> class="active nav-item dropdown" <?php else:?> class="nav-item dropdown"  <?php endif; ?> >
          <a class="nav-link dropdown-toggle" data-toggle="dropdown" href="#" role="button" aria-haspopup="true" aria-expanded="true">数据统计</a>
          <div class="dropdown-menu" x-placement="bottom-start" style="position: absolute; transform: translate3d(0px, 35px, 0px); top: 0px; left: 0px; will-change: transform;">
              <?php foreach ($this->layout['menu_list']['stat']['stat']['childs'] as $action => $child_row): ?>
                <a class="dropdown-item" href="<?php echo $child_row['href'] ?>"><?php echo $child_row['title'] ?></a>
              <?php endforeach; ?>
          </div>
        </li>
        <li <?php if ($this->layout['current_controller'] == 'tool' && $this->layout['current_module'] == 'manage'): ?> class="active nav-item dropdown" <?php else:?> class="nav-item dropdown" <?php endif; ?> >
          <a class="nav-link dropdown-toggle" data-toggle="dropdown" href="#" role="button" aria-haspopup="true" aria-expanded="true">工具</a>
          <div class="dropdown-menu" x-placement="bottom-start" style="position: absolute; transform: translate3d(0px, 35px, 0px); top: 0px; left: 0px; will-change: transform;">
              <?php foreach ($this->layout['menu_list']['tool']['tool']['childs'] as $action => $child_row): ?>
                <a class="dropdown-item" href="<?php echo $child_row['href'] ?>"><?php echo $child_row['title'] ?></a>
              <?php endforeach; ?>
          </div>
        </li>
        <li <?php if ($this->layout['current_controller'] == 'ss' && $this->layout['current_module'] == 'manage'): ?> class="active nav-item dropdown" <?php else:?> class="nav-item dropdown" <?php endif; ?> >
          <a class="nav-link dropdown-toggle" data-toggle="dropdown" href="#" role="button" aria-haspopup="true" aria-expanded="true">自助用户管理</a>
          <div class="dropdown-menu" x-placement="bottom-start" style="position: absolute; transform: translate3d(0px, 35px, 0px); top: 0px; left: 0px; will-change: transform;">
              <?php foreach ($this->layout['menu_list']['ss']['ss']['childs'] as $action => $child_row): ?>
                <a class="dropdown-item" href="<?php echo $child_row['href'] ?>"><?php echo $child_row['title'] ?></a>
              <?php endforeach; ?>
          </div>
        </li>
        <?php if (!empty($this->layout['user']['groupid']) && ($this->layout['user']['groupid'] > 5)): ?>
          <li class="nav-item">
            <a href="/manage/operate/index/" class="nav-link">管理</a>
          </li>
        <?php endif; ?>
      </ul>
      <ul class="nav navbar-nav navbar-right">
          <?php if (isset($this->layout['user_is_logined']) && $this->layout['user_is_logined'] === 0): ?>
            <li>
              <a href="/manage/index/login" class="normalLink">
                <button class="btn btn-secondary my-2 my-sm-0"> 登录 </button>
              </a>
            </li>
          <?php else: ?>
            <li>
              <a rel="nofollow" href="/manage/index/modinfo/"  class="normalLink">
                <button class="btn btn-link"><?php echo htmlspecialchars(substr($this->layout['user']['email'], 0, strpos($this->layout['user']['email'], '@'))); ?>
                </button>
              </a>
            </li>
            <li>
              <a href="/manage/index/logout" class="normalLink"><button class="btn btn-secondary my-2 my-sm-0"> 退出 </button></a>
            </li>
          <?php endif; ?>
      </ul>
    </div>
  </nav>
</div>
<div class="container">
    <?php if (isset($this->layout['popup_message']) && !empty($this->layout['popup_message'])): ?>
      <div class="alert alert-dismissible alert-warning" id="warningMsg">
        <button type="button" class="close" data-dismiss="alert">&times;</button>
        <h4 class="alert-heading">Warning!</h4>
        <p class="mb-0"><?php echo htmlspecialchars($this->layout['popup_message']) ?></p>
      </div>
    <?php endif; ?>
    <?php echo $this->content; ?>
</div>
<div class="container">
  <div class="col-lg-12">
    <p>2019 touhaoshiwan , Inc.</p>
    <p>Code released under the <a href="#">MIT License</a>.</p>
  </div>
</div>

<script type="text/javascript">
  jQuery.datetimepicker.setLocale('ch');
  $(function () {
    $('.dropdown-toggle').dropdown()
  })

  function delConfirm(url) {
    if (confirm("确认执行本次操作？")) {
      location.href = url;
    }
    else{
      return false;
    }
  }

</script>
</body>
</html>
